<!--$Id: 登陆模块  liuricheng  201-03-14	$-->
{/* 引入css,js */}
<css href="__PUBLIC__/css/lrc_test.css" />
<css href="__PUBLIC__/css/jquery-ui.css" />
<js href="__PUBLIC__/js/core/jquery-1.8.0.js" />
<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
<js href="__PUBLIC__/js/core/plugins.js"/>
<js href="__PUBLIC__/js/core/jquery.form.js" />
{/* 引入css,js */}

<style>
.login_panel{width:440px;height:290px;margin-top:220px;margin-left:450px;position:absolute;background:url(__PUBLIC__/image/Login/bg_admin_login_form.png) no-repeat 2px top;}.user_icons{background:url(__PUBLIC__/image/Login/bg_admin_login_icons.png);}.user_icons input{border:none;background:#f0eef0;width:285px;padding:16px 10px;font-size:15px;outline:none;font-weight:500;color:#999;font-family:Arial,'微软雅黑';}.username_wrap{margin-top:60px;width:356px;height:50px;margin-left:37px;}.pwd_wrap{margin-top:20px;width:356px;height:50px;margin-left:37px;}.user_head{background-position:0px -55px;width:24px;height:25px;margin:10px 0px 0px 2px;}.submit_wrap{margin-left:37px;margin-top:33px;}.pwd_lock{background-position:-25px -55px;width:24px;height:25px;margin:10px 0px 0px 2px;}#submit_btn{width:100px;height:42px;display:block;border:none;color:#fff;outline:none;font-family:'微软雅黑';font-weight:600;font-size:17px;letter-spacing:10px;cursor:pointer;}.submit_btn{background-position:0px -81px;}.submit_btn_hover{background-position:0px -122px;}
</style>

<form id="loginForm"name="loginform"method="post"action="__URL__/checkLogin"><div class="login_panel"><div><!--userName--><div class="user_icons username_wrap"><span class="dp l_fl"style="width:24px;"><i class="dp user_icons user_head"></i></span><span class="dp ll_fl"><input id="name" type="text"name="username"value=""/></span><div class="clf"></div></div><!--password--><div class="user_icons pwd_wrap"><span class="dp l_fl"style="width:24px;"><i class="dp user_icons pwd_lock"></i></span><span class="dp ll_fl"><input id="password" type="password"name="password"value=""/></span><div class="clf"></div></div><!--submit_button--><div class="submit_wrap"><span class="dp l_fl"><input type="submit"id="submit_btn"class="user_icons submit_btn"value="登录"/></span><span class="dp l_fl"style="margin:10px 0px 0px 12px; color:#1d1610; font-size:14px; font-family:'微软雅黑';"><input id="rem_btn" type="checkbox"/>&nbsp;记住登陆信息</span><div class="clf"></div></div></div></div></form><div id="loading"class="hide"><!--Qloading:不能删除--></div>

<script type="text/javascript">
	// 提交按钮hover
	$('#submit_btn').hover(function(){
		$(this).removeClass('submit_btn').addClass('submit_btn_hover');
	},function(){
		$(this).removeClass('submit_btn_hover').addClass('submit_btn');
	});
	
	// 提交表单
	/*	
	 $(document).ready(function() {
	 	$('#loginForm').ajaxForm({
	 	   //target: '#output',          //把服务器返回的内容放入id为output的元素中
	 	   beforeSubmit: function(formData, jqForm, options){	 //提交前的回调函数  
	 	   		$('#loading').QLoading("open");
	 	   },  
		   success: function(msg, statusText){          //提交后的回调函数  			  
			   if(msg.num == 1){
				    $('#loading').QLoading("close");  
				    navigate(msg);
			   }
			   else{
				   $('#loading').QLoading({time:2,status:'close',"text":'登陆失败',img:'sad'});   
			   }
		   }, 
		   //url: url,                 //默认是form的action， 如果申明，则会覆盖  
		   //type: type,               //默认是form的method（get or post），如果申明，则会覆盖  
		   //dataType: null,           //html(默认), xml, script, json...接受服务端返回的类型  
		   //clearForm: true,          //成功提交后，清除所有表单元素的值  
		   //resetForm: false,          //成功提交后，重置所有表单元素的值  
		   timeout: 3000               //限制请求的时间，当请求大于3秒后，跳出请求 
	 	});
	}); 
	*/
	
	
	/**
		var COOKIE_NAME = 'test_cookie';    
		 //设置cookie，通过时间间隔    
		 $('a').eq(0).click(function() {    
			 $.cookie(COOKIE_NAME, 'test', { path: '/', expires: 1 });    
			 return false;    
		 });    
		 // 设置cookie，到期时间    
		 $('a').eq(1).click(function() {    
			 var date = new Date();    
			 date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000));    
			 $.cookie(COOKIE_NAME, 'test', { path: '/', expires: date });    
			 return false;    
		 });    
		 // 获取 cookie    
		 $('a').eq(2).click(function() {    
			 alert($.cookie(COOKIE_NAME));    
			 return false;    
		 });    
		 // 删除cookie    
		 $('a').eq(3).click(function() {    
			 $.cookie(COOKIE_NAME, null, { path: '/' });    
			 return false;    
		 });  
		*/
		
	// 记住用户名和密码
	$('#rem_btn').click(function(){
		var datas	=	$('#loginForm').QVal();
		if($(this).attr('checked') == 'checked'){
			(datas['name'] != '') ? $.cookie('name',datas.name) :false;
			(datas['password'] != '') ? $.cookie('password',datas.password) :false;
		}
		else{
			$.cookie('name',null);
			$.cookie('password',null);
		}		
		return true;
	});
	
	if(typeof $.cookie('name') != 'undefined' && $.cookie('name') != 'null'){
		$('#name').attr('value',$.cookie('name'));
	}
	if(typeof $.cookie('password') != 'undefined' && $.cookie('password') != 'null'){
		$('#password').attr('value',$.cookie('password'));
		$('#rem_btn').attr('checked','checked');
	}
	
	
</script>